
#include "../libpatches.h"
#include "cos.h"
#include "math.h"

static void module_cos_processor(module m);

void module_cos_initializer(module m) {
	make_inputs(m, 1);
	make_outputs(m, 1);

	m->input_names[0] = "in";
	m->output_names[0] = "out";

	m->processor = module_cos_processor;
}

static void module_cos_processor(module m) {
	static sample twopi = 2 * M_PI;

	output o = m->outputs[0];
	input i = m->inputs[0];

	*o = cos(**i * twopi);
}

